package com.wsseieiei.fireballgame.entity;

import com.wsseieiei.fireballgame.init.ItemInit;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.projectile.Snowball;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.EntityHitResult;
public class EntityBall2test extends Snowball {
    public EntityBall2test(Level p_37399_, LivingEntity p_37400_) {
        super(p_37399_, p_37400_);
    }
    public EntityBall2test(EntityType<? extends Snowball> p_37391_, Level p_37392_) {
        super(p_37391_, p_37392_);
    }
    protected void onHitEntity(EntityHitResult result) {
        super.onHitEntity(result);
//        Entity entity = result.getEntity();
//        entity.setSecondsOnFire(1);
        var item = new ItemStack(ItemInit.BALL.get());
        this.level.addFreshEntity(new ItemEntity(this.level, this.getX(), this.getY(), this.getZ(), item));
    }
}
